install.packages(c("tidyverse"))
library(tidyverse)

## Loading all data
load("ndeal.RData")
load("census1930.RData")

## Merge together
distrib = ndeal %>%
  left_join(., census1930, by = "my_fips") 

##  TABLE A1 ##

cor(distrib$pct_urban, I(log(distrib$pc_wpa + 1)), use="complete.obs")
cor(distrib$pct_urban, I(log(distrib$pc_pwa + 1)), use="complete.obs")

cor(distrib$pct_black, I(log(distrib$pc_wpa + 1)), use="complete.obs")
cor(distrib$pct_black, I(log(distrib$pc_pwa + 1)), use="complete.obs")

cor(distrib$pct_foreign, I(log(distrib$pc_wpa + 1)), use="complete.obs")
cor(distrib$pct_foreign, I(log(distrib$pc_pwa + 1)), use="complete.obs")

cor(distrib$pct_unemp, I(log(distrib$pc_wpa + 1)), use="complete.obs")
cor(distrib$pct_unemp, I(log(distrib$pc_pwa + 1)), use="complete.obs")
